function cell = keygen(N,imin,imax,char,prob)

    cell = zeros(N,1);
    lenChar = length(char);
    lenProb = length(prob);

    if nargin < 4
        error('wrong number of inputs')
    end
    
    if nargin == 4
        lenprob(1:lenChar) = 0.5;
    end

    for k = 0 : N
        lenKey = randi([imin,imax]);
        key = randsrc(lenKey,1,[char; prob]);
        cell(k,1) = key;
    end
prin(cell)
end




